<?php
/**
 * Created by PhpStorm.
 * User: Soha_Ros
 * Date: 17/6/10
 * Time: 下午1:50
 */

namespace ActionsHttp;


use Data\Table_dining;
use Data\Table_dining_DAO;

class TableAdd extends BaseActionHttp
{
    public function doAction() {

        parent::doAction();

        // 商铺id
        $restaurant_id = $_SESSION[RESTAURANT_ID];
        $restaurant_id = 1;

        $table_record = new Table_dining(array());
        $table_record->setRESTAURANT_ID($restaurant_id);
        $table_record->setTABLE_NUM($this->data[TABLE_NUM]);
        $table_record->setMAX_CAPACITY($this->data[MAX_CAPACITY]);

        // 插入
        $table_id = Table_dining_DAO::insert($table_record);

        $this->setValue(TABLE_ID,$table_id);

        // 返回数据
        $this->ResponseDataToCurrentClient();

    }
}